#! /bin/sh

name=libwebp
version=1.5.0
revision=1
tarball_url="https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${version}.tar.gz"
tarball_blake2b="68e94f5592556ac4b57011a94abc651a187b23ca7cddd6791aec3f62bede7a7c176d4a67f8170a83990a6ff290a6716011bdb117818657b63bd3e21a8d5ed59e"
hostdeps="gcc pkg-config"
deps="core-libs libjpeg-turbo libpng freeglut sdl2-compat libtiff"

prepare() {
    autotools_recursive_regen
}

configure() {
    autotools_configure \
        --enable-libwebpmux \
        --enable-libwebpdemux \
        --enable-libwebpdecoder \
        --enable-libwebpextras \
        --enable-swap-16bit-csp
}

build() {
    make -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make install

    post_package_strip
}
